/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
/* Generated By:JavaCC: Do not edit this line. ParamParser.java */
                           // Robocup Message Parser
package robocup.parser9;

// The player and the Controller
// import robocup.atan.model.*;
import robocup.component.SConf;
import robocup.component.PConf;
import robocup.component.AbstractAgent;
import robocup.component.infotypes.PlayerTypesInfo;
import robocup.component.infotypes.PlayerParamInfo;
import robocup.component.infotypes.ServerParamInfo;
import robocup.component.infotypes.Info;
import java.io.StringReader;

/**
 * The Parser for Parameter-Infos such as PlayerTypes, the Server-parameters or
 * the PlayerParameters. This class is created by the
 * javacc parser generator. Therefore do not change this class directly,
 * but change the ParamParser.jj and regenerate the code afterwards.
 */
public class ParamParser implements ParamParserConstants {

  /**
   * The Info for PlayerTypes.
   */
  PlayerTypesInfo pti = new PlayerTypesInfo();

  /**
   * The info storing the server parameters.
   */
  ServerParamInfo spi = new ServerParamInfo();

  /**
   * The info stroing the player parameters.
   */
  PlayerParamInfo ppi = new PlayerParamInfo();

  /**
   * A reference to the agent, which contains the parser.
   */
  AbstractAgent rc;

  /**
   * The returned info, i.e. a PlayerType-, ServerParam- or PlayerParamInfo.
   */
  Info info;

        /**
	 * Creates a new instance of the parser.
	 * @param - StringReader - reader for accessing strings
	 * @param - AbstractAgent - the agent object containing this parser
	 */
  public ParamParser(StringReader str, AbstractAgent rc) {
        this(str);
        this.rc = rc;
  }

  /**
   * Parses a ServerParam-Message and returns the corresponding info.
   */
  public Info parseServerParam(String cmd)
        throws ParseException{
      ReInit(new StringReader(cmd));

      try {
        startServerParam();
      } catch (ParseException e) {
        System.out.println("Exception during Parsing with Command:");
        System.out.println("  " + cmd +"\r\n"+ e);
        e.printStackTrace();
      }
          return spi;
  }

  /**
   * Parses a PlayerParam-Message and returns the corresponding info.
   */
  public Info parsePlayerParam(String cmd)
        throws ParseException{
      ReInit(new StringReader(cmd));

      try {
        startPlayerParam();
      } catch (ParseException e) {
        System.out.println("Exception during Parsing with Command:");
        System.out.println("  " + cmd +"\r\n"+ e);
        e.printStackTrace();
      }
          return ppi;
  }

  /**
   * Parses a PlayerType-Message and returns the corresponding info.
   */
  public Info parsePlayerType(String cmd)
        throws ParseException{
      ReInit(new StringReader(cmd));

      try {
        startPlayerType();
      } catch (Exception e) {
        System.out.println("Exception during Parsing with Command:");
        System.out.println("  " + cmd +"\r\n"+ e);
        e.printStackTrace();
      }
      return pti;
  }

  final public void startServerParam() throws ParseException {
        // TODO Implement all serverparameters, now just some are used to fill sconf and pconf
        //(audio_cut_dist 50)(back_passes 1)(ball_accel_max 2.7)(ball_decay 0.94)(ball_rand 0.05)
        //(ball_size 0.085)(ball_speed_max 2.7)(ball_weight 0.2)(catch_ban_cycle 5)(catch_probability 1)
        //(catchable_area_l 2)(catchable_area_w 1)(ckick_margin 1)(dash_power_rate 0.006)(effort_dec 0.005)
        //(effort_dec_thr 0.3)(effort_inc 0.01)(effort_inc_thr 0.6)(effort_init 1)(effort_min 0.6)
        //(goal_width 14.02)(goalie_max_moves 2)(half_time 30)(hear_decay 1)(hear_inc 1)(hear_max 1)
        //(inertia_moment 5)(kick_power_rate 0.027)(kick_rand 0)(kick_rand_factor_l 1)
        //(kick_rand_factor_r 1)(kickable_margin 0.7)(max_goal_kicks 3)(maxmoment 180)(maxneckang 90)
        //(maxneckmoment 180)(maxpower 100)(minmoment -180)(minneckang -90)(minneckmoment -180)
        //(minpower -100)(nr_extra_halfs 2)(nr_normal_halfs 2)(offside_active_area_size 2.5)
        //(offside_kick_margin 9.15)(pen_dist_x 42.5)(pen_max_goalie_dist_x 14)(player_accel_max 1)
        //(player_decay 0.4)(player_rand 0.1)(player_size 0.3)(player_speed_max 1.2)(player_weight 60)
        //(point_to_ban 5)(point_to_duration 20)(recover_dec 0.002)(recover_dec_thr 0.3)
        //(recover_init 1)(recover_min 0.5)(stamina_inc_max 45)(stamina_max 4000)(stopped_ball_vel 0.01)
        //(tackle_back_dist 0.5)(tackle_cycles 10)(tackle_dist 2)(tackle_exponent 6)
        //(tackle_power_rate 0.027)(tackle_width 1)
                SConf sc = SConf.getInstance();
    label_1:
    while (true) {
      switch (jj_nt.kind) {
      case OB:
        ;
        break;
      default:
        jj_la1[0] = jj_gen;
        break label_1;
      }
      jj_consume_token(OB);
      switch (jj_nt.kind) {
      case AUDIO_CUT_DIST:
      case BACK_PASSES:
      case BALL_ACCEL_MAX:
      case BALL_DECAY:
      case BALL_RAND:
      case BALL_SIZE:
      case BALL_SPEED_MAX:
      case BALL_WEIGHT:
      case CATCH_BAN_CYCLE:
      case CATCH_PROBABILITY:
      case CATCHABLE_AREA_L:
      case CATCHABLE_AREA_W:
      case CKICK_MARGIN:
      case CLANG_WIN_SIZE:
      case COACH:
      case DASH_POWER_RATE:
      case EFFORT_DEC:
      case EFFORT_DEC_THR:
      case EFFORT_INC:
      case EFFORT_INC_THR:
      case EFFORT_INIT:
      case EFFORT_MIN:
      case FREEFORM_SEND_PERIOD:
      case FREEFORM_WAIT_PERIOD:
      case GOAL_WIDTH:
      case GOALIE_MAX_MOVES:
      case HALF_TIME:
      case HEAR_DECAY:
      case HEAR_INC:
      case HEAR_MAX:
      case INERTIA_MOMENT:
      case KICK_POWER_RATE:
      case KICK_RAND:
      case KICK_RAND_FACTOR_L:
      case KICK_RAND_FACTOR_R:
      case KICKABLE_MARGIN:
      case MAX_GOAL_KICKS:
      case MAXMOMENT:
      case MAXNECKANG:
      case MAXNECKMOMENT:
      case MAXPOWER:
      case MINMOMENT:
      case MINNECKANG:
      case MINNECKMOMENT:
      case OFFSIDE_KICK_MARGIN:
      case PEN_DIST_X:
      case PEN_MAX_GOALIEDIST_X:
      case PLAYER_ACCEL_MAX:
      case PLAYER_DECAY:
      case PLAYER_RAND:
      case PLAYER_SIZE:
      case PLAYER_SPEED_MAX:
      case PLAYER_WEIGHT:
      case POINT_TO_BAN:
      case POINT_TO_DURATION:
      case RECOVER_DEC:
      case RECOVER_DEC_THR:
      case RECOVER_INIT:
      case RECOVER_MIN:
      case SAY_COACH_COUNT_MAX:
      case STAMINA_INC_MAX:
      case STAMINA_MAX:
      case STOPPED_BALL_VEL:
      case TACKLE_BACK_DIST:
      case TACKLE_CYCLES:
      case TACKLE_DIST:
      case TACKLE_EXPONENT:
      case TACKLE_POWER_RATE:
      case TACKLE_WIDTH:
      case VISIBLE_DISTANCE:
        usefulServerParam(sc);
        break;
      default:
        jj_la1[1] = jj_gen;
        useless();
      }
      jj_consume_token(CB);
    }
                /*
		if (rc.getMode() == RobocupAgent.TRAINER
   		    || rc.getMode() == RobocupAgent.COACH)
        	rc.getCoachWorld().setSConf(sc);
        else 
        	rc.getWorld().setSConf(sc);
        */
        spi.setSConf(sc);
  }

  final public void startPlayerParam() throws ParseException {
    label_2:
    while (true) {
      switch (jj_nt.kind) {
      case OB:
        ;
        break;
      default:
        jj_la1[2] = jj_gen;
        break label_2;
      }
      jj_consume_token(OB);
      switch (jj_nt.kind) {
      case DASH_POWER_RATE_DELTA_MAX:
      case DASH_POWER_RATE_DELTA_MIN:
      case EFFORT_MAX_DELTA_FACTOR:
      case EFFORT_MIN_DELTA_FACTOR:
      case EXTRA_STAMINA_DELTA_MAX:
      case EXTRA_STAMINA_DELTA_MIN:
      case INERTIA_MOMENT_DELTA_FACTOR:
      case KICK_RAND_DELTA_FACTOR:
      case KICKABLE_MARGIN_DELTA_MAX:
      case KICKABLE_MARGIN_DELTA_MIN:
      case NEW_DASH_POWER_RATE_DELTA_MAX:
      case NEW_DASH_POWER_RATE_DELTA_MIN:
      case NEW_STAMINA_INC_MAX_DELTA_FACTOR:
      case PLAYER_DECAY_DELTA_MAX:
      case PLAYER_DECAY_DELTA_MIN:
      case PLAYER_SIZE_DELTA_FACTOR:
      case PLAYER_SPEED_MAX_DELTA_MAX:
      case PLAYER_SPEED_MAX_DELTA_MIN:
      case PLAYER_TYPES:
      case PT_MAX:
      case RANDOM_SEED:
      case STAMINA_INC_MAX_DELTA_FACTOR:
      case SUBS_MAX:
        usefulPlayerParam();
        break;
      default:
        jj_la1[3] = jj_gen;
        useless();
      }
      jj_consume_token(CB);
    }
  }

  final public void startPlayerType() throws ParseException {
                PConf pc = new PConf();
                Token num; Token id;
    jj_consume_token(OB);
    jj_consume_token(ID);
    jj_consume_token(SEP);
    id = jj_consume_token(NUM);
    jj_consume_token(CB);
                                  pc.setId(Integer.parseInt(id.image));
    jj_consume_token(OB);
    jj_consume_token(PLAYER_SPEED_MAX);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                                 pc.PLAYER_SPEED_MAX = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(STAMINA_INC_MAX);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                                pc.STAMINA_INC_MAX = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(PLAYER_DECAY);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                             pc.PLAYER_DECAY = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(INERTIA_MOMENT);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                               pc.INERTIA_MOMENT = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(DASH_POWER_RATE);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                                pc.DASH_POWER_RATE = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(PLAYER_SIZE);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                            pc.PLAYER_SIZE = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(KICKABLE_MARGIN);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                                pc.KICKABLE_MARGIN = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(KICK_RAND);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                          pc.KICK_RAND = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(EXTRA_STAMINA);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                              pc.EXTRA_STAMINA = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(EFFORT_MAX);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                           pc.EFFORT_MAX = Double.parseDouble(num.image);
    jj_consume_token(OB);
    jj_consume_token(EFFORT_MIN);
    jj_consume_token(SEP);
    num = jj_consume_token(NUM);
    jj_consume_token(CB);
                                           pc.EFFORT_MIN = Double.parseDouble(num.image);
                pc.setPlayerParamInfo(ppi);
                pti.fillInType(pc);
                /*
		if(Integer.parseInt(id.image)==(pti.PLAYER_TYPES-1)){
			// controller.sendPlayerTypesInfo(pti);
		}
		if (rc.getMode() == RobocupAgent.COACH ||
        	rc.getMode() == RobocupAgent.TRAINER)
        	rc.getCoachWorld().setPConf(pc);
        else 
        	rc.getWorld().setPConf(pc);
        */

  }

  final public void usefulServerParam(SConf sc) throws ParseException {
        Token num;
    switch (jj_nt.kind) {
    case AUDIO_CUT_DIST:
      jj_consume_token(AUDIO_CUT_DIST);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                               sc.AUDIO_CUT_DIST = Double.parseDouble(num.image);
      break;
    case BACK_PASSES:
      jj_consume_token(BACK_PASSES);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.BACK_PASSES = Double.parseDouble(num.image);
      break;
    case BALL_ACCEL_MAX:
      jj_consume_token(BALL_ACCEL_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                sc.BALL_ACC_MAX = Double.parseDouble(num.image);
      break;
    case BALL_DECAY:
      jj_consume_token(BALL_DECAY);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.BALL_DECAY = Double.parseDouble(num.image);
      break;
    case BALL_RAND:
      jj_consume_token(BALL_RAND);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                           sc.BALL_RAND = Double.parseDouble(num.image);
      break;
    case BALL_SIZE:
      jj_consume_token(BALL_SIZE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                           sc.BALL_SIZE = Double.parseDouble(num.image);
      break;
    case BALL_SPEED_MAX:
      jj_consume_token(BALL_SPEED_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                sc.BALL_SPEED_MAX = Double.parseDouble(num.image);
      break;
    case BALL_WEIGHT:
      jj_consume_token(BALL_WEIGHT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.BALL_WEIGHT = Double.parseDouble(num.image);
      break;
    case CATCH_BAN_CYCLE:
      jj_consume_token(CATCH_BAN_CYCLE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 sc.CATCH_BAN_CYCLE = Double.parseDouble(num.image);
      break;
    case CATCH_PROBABILITY:
      jj_consume_token(CATCH_PROBABILITY);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                   sc.CATCH_PROBABILITY = Double.parseDouble(num.image);
      break;
    case CATCHABLE_AREA_L:
      jj_consume_token(CATCHABLE_AREA_L);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.CATCHABLE_AREA_L = Double.parseDouble(num.image);
      break;
    case CATCHABLE_AREA_W:
      jj_consume_token(CATCHABLE_AREA_W);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.CATCHABLE_AREA_W = Double.parseDouble(num.image);
      break;
    case CKICK_MARGIN:
      jj_consume_token(CKICK_MARGIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                              sc.CKICK_MARGIN = Double.parseDouble(num.image);
      break;
    case CLANG_WIN_SIZE:
      jj_consume_token(CLANG_WIN_SIZE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                sc.CLANG_WIN_SIZE = (Integer.parseInt(num.image));
      break;
    case COACH:
      jj_consume_token(COACH);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                       sc.COACH = (Integer.parseInt(num.image)==1);
      break;
    case DASH_POWER_RATE:
      jj_consume_token(DASH_POWER_RATE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case EFFORT_DEC:
      jj_consume_token(EFFORT_DEC);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.EFFORT_DEC = Double.parseDouble(num.image);
      break;
    case EFFORT_DEC_THR:
      jj_consume_token(EFFORT_DEC_THR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                sc.EFFORT_DEC_THR = Double.parseDouble(num.image);
      break;
    case EFFORT_INC:
      jj_consume_token(EFFORT_INC);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.EFFORT_INC = Double.parseDouble(num.image);
      break;
    case EFFORT_INC_THR:
      jj_consume_token(EFFORT_INC_THR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                sc.EFFORT_INC_THR = Double.parseDouble(num.image);
      break;
    case EFFORT_INIT:
      jj_consume_token(EFFORT_INIT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.EFFORT_INIT = Double.parseDouble(num.image);
      break;
    case EFFORT_MIN:
      jj_consume_token(EFFORT_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case FREEFORM_SEND_PERIOD:
      jj_consume_token(FREEFORM_SEND_PERIOD);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                      sc.FREEFORM_SEND_PERIOD = Integer.parseInt(num.image);
      break;
    case FREEFORM_WAIT_PERIOD:
      jj_consume_token(FREEFORM_WAIT_PERIOD);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                      sc.FREEFORM_WAIT_PERIOD = Integer.parseInt(num.image);
      break;
    case GOAL_WIDTH:
      jj_consume_token(GOAL_WIDTH);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.GOAL_WIDTH = Double.parseDouble(num.image);
      break;
    case GOALIE_MAX_MOVES:
      jj_consume_token(GOALIE_MAX_MOVES);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.GOALIE_MAX_MOVES = Integer.parseInt(num.image);
      break;
    case HALF_TIME:
      jj_consume_token(HALF_TIME);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                           sc.HALF_TIME = Double.parseDouble(num.image);
      break;
    case HEAR_DECAY:
      jj_consume_token(HEAR_DECAY);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.HEAR_DECAY = Double.parseDouble(num.image);
      break;
    case HEAR_INC:
      jj_consume_token(HEAR_INC);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                          sc.HEAR_INC = Double.parseDouble(num.image);
      break;
    case HEAR_MAX:
      jj_consume_token(HEAR_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                          sc.HEAR_MAX = Double.parseDouble(num.image);
      break;
    case INERTIA_MOMENT:
      jj_consume_token(INERTIA_MOMENT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case KICK_POWER_RATE:
      jj_consume_token(KICK_POWER_RATE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 sc.KICK_POWER_RATE = Double.parseDouble(num.image);
      break;
    case KICK_RAND:
      jj_consume_token(KICK_RAND);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case KICK_RAND_FACTOR_L:
      jj_consume_token(KICK_RAND_FACTOR_L);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case KICK_RAND_FACTOR_R:
      jj_consume_token(KICK_RAND_FACTOR_R);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case KICKABLE_MARGIN:
      jj_consume_token(KICKABLE_MARGIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case MAX_GOAL_KICKS:
      jj_consume_token(MAX_GOAL_KICKS);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                sc.MAX_GOAL_KICKS = Double.parseDouble(num.image);
      break;
    case MAXMOMENT:
      jj_consume_token(MAXMOMENT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                           sc.MAXMOMENT = Double.parseDouble(num.image);
      break;
    case MAXNECKANG:
      jj_consume_token(MAXNECKANG);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.MAXNECKANG = Double.parseDouble(num.image);
      break;
    case MAXNECKMOMENT:
      jj_consume_token(MAXNECKMOMENT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                               sc.MAXNECKMOMENT = Double.parseDouble(num.image);
      break;
    case MAXPOWER:
      jj_consume_token(MAXPOWER);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                          sc.MAXPOWER = Double.parseDouble(num.image);
      break;
    case MINMOMENT:
      jj_consume_token(MINMOMENT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                           sc.MINMOMENT = Double.parseDouble(num.image);
      break;
    case MINNECKANG:
      jj_consume_token(MINNECKANG);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                            sc.MINNECKANG = Double.parseDouble(num.image);
      break;
    case MINNECKMOMENT:
      jj_consume_token(MINNECKMOMENT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                               sc.MINNECKMOMENT = Double.parseDouble(num.image);
      break;
    case OFFSIDE_KICK_MARGIN:
      jj_consume_token(OFFSIDE_KICK_MARGIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case PEN_DIST_X:
      jj_consume_token(PEN_DIST_X);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case PEN_MAX_GOALIEDIST_X:
      jj_consume_token(PEN_MAX_GOALIEDIST_X);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case PLAYER_ACCEL_MAX:
      jj_consume_token(PLAYER_ACCEL_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.PLAYER_ACCEL_MAX = Double.parseDouble(num.image);
      break;
    case PLAYER_DECAY:
      jj_consume_token(PLAYER_DECAY);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case PLAYER_RAND:
      jj_consume_token(PLAYER_RAND);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.PLAYER_RAND = Double.parseDouble(num.image);
      break;
    case PLAYER_SIZE:
      jj_consume_token(PLAYER_SIZE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case PLAYER_SPEED_MAX:
      jj_consume_token(PLAYER_SPEED_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case PLAYER_WEIGHT:
      jj_consume_token(PLAYER_WEIGHT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                               sc.PLAYER_WEIGHT = Double.parseDouble(num.image);
      break;
    case POINT_TO_BAN:
      jj_consume_token(POINT_TO_BAN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                              sc.POINT_TO_BAN = Integer.parseInt(num.image);
      break;
    case POINT_TO_DURATION:
      jj_consume_token(POINT_TO_DURATION);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                   sc.POINT_TO_DURATION = Integer.parseInt(num.image);
      break;
    case RECOVER_DEC:
      jj_consume_token(RECOVER_DEC);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.RECOVER_DEC = Double.parseDouble(num.image);
      break;
    case RECOVER_DEC_THR:
      jj_consume_token(RECOVER_DEC_THR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 sc.RECOVER_DEC_THR = Double.parseDouble(num.image);
      break;
    case RECOVER_INIT:
      jj_consume_token(RECOVER_INIT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                              sc.RECOVER_INIT = Double.parseDouble(num.image);
      break;
    case RECOVER_MIN:
      jj_consume_token(RECOVER_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.RECOVER_MIN = Double.parseDouble(num.image);
      break;
    case SAY_COACH_COUNT_MAX:
      jj_consume_token(SAY_COACH_COUNT_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                     sc.SAY_COACH_COUNT_MAX = Integer.parseInt(num.image);
      break;
    case STAMINA_INC_MAX:
      jj_consume_token(STAMINA_INC_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);

      break;
    case STAMINA_MAX:
      jj_consume_token(STAMINA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.STAMINA_MAX = Double.parseDouble(num.image);
      break;
    case STOPPED_BALL_VEL:
      jj_consume_token(STOPPED_BALL_VEL);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.STOPPED_BALL_VEL = Double.parseDouble(num.image);
      break;
    case TACKLE_BACK_DIST:
      jj_consume_token(TACKLE_BACK_DIST);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.TACKLE_BACK_DIST = Double.parseDouble(num.image);
      break;
    case TACKLE_CYCLES:
      jj_consume_token(TACKLE_CYCLES);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                               sc.TACKLE_CYCLES = Integer.parseInt(num.image);
      break;
    case TACKLE_DIST:
      jj_consume_token(TACKLE_DIST);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                             sc.TACKLE_DIST = Double.parseDouble(num.image);
      break;
    case TACKLE_EXPONENT:
      jj_consume_token(TACKLE_EXPONENT);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 sc.TACKLE_EXPONENT = Double.parseDouble(num.image);
      break;
    case TACKLE_POWER_RATE:
      jj_consume_token(TACKLE_POWER_RATE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                   sc.TACKLE_POWER_RATE = Double.parseDouble(num.image);
      break;
    case TACKLE_WIDTH:
      jj_consume_token(TACKLE_WIDTH);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                              sc.TACKLE_WIDTH = Double.parseDouble(num.image);
      break;
    case VISIBLE_DISTANCE:
      jj_consume_token(VISIBLE_DISTANCE);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  sc.VISIBLE_DISTANCE = Double.parseDouble(num.image);
      break;
    default:
      jj_la1[4] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void usefulPlayerParam() throws ParseException {
        Token num;
    switch (jj_nt.kind) {
    case DASH_POWER_RATE_DELTA_MAX:
      jj_consume_token(DASH_POWER_RATE_DELTA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  ppi.DASH_POWER_RATE_DELTA_MAX = Double.parseDouble(num.image);
      break;
    case DASH_POWER_RATE_DELTA_MIN:
      jj_consume_token(DASH_POWER_RATE_DELTA_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                   ppi.DASH_POWER_RATE_DELTA_MIN = Double.parseDouble(num.image);
      break;
    case EFFORT_MAX_DELTA_FACTOR:
      jj_consume_token(EFFORT_MAX_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 ppi.EFFORT_MAX_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case EFFORT_MIN_DELTA_FACTOR:
      jj_consume_token(EFFORT_MIN_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 ppi.EFFORT_MIN_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case EXTRA_STAMINA_DELTA_MAX:
      jj_consume_token(EXTRA_STAMINA_DELTA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 ppi.EXTRA_STAMINA_DELTA_MAX = Double.parseDouble(num.image);
      break;
    case EXTRA_STAMINA_DELTA_MIN:
      jj_consume_token(EXTRA_STAMINA_DELTA_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                 ppi.EXTRA_STAMINA_DELTA_MIN = Double.parseDouble(num.image);
      break;
    case INERTIA_MOMENT_DELTA_FACTOR:
      jj_consume_token(INERTIA_MOMENT_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                     ppi.INERTIA_MOMENT_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case KICK_RAND_DELTA_FACTOR:
      jj_consume_token(KICK_RAND_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                ppi.KICK_RAND_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case KICKABLE_MARGIN_DELTA_MAX:
      jj_consume_token(KICKABLE_MARGIN_DELTA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                   ppi.KICKABLE_MARGIN_DELTA_MAX = Double.parseDouble(num.image);
      break;
    case KICKABLE_MARGIN_DELTA_MIN:
      jj_consume_token(KICKABLE_MARGIN_DELTA_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                   ppi.KICKABLE_MARGIN_DELTA_MIN = Double.parseDouble(num.image);
      break;
    case NEW_DASH_POWER_RATE_DELTA_MAX:
      jj_consume_token(NEW_DASH_POWER_RATE_DELTA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                       ppi.NEW_DASH_POWER_RATE_DELTA_MAX = Double.parseDouble(num.image);
      break;
    case NEW_DASH_POWER_RATE_DELTA_MIN:
      jj_consume_token(NEW_DASH_POWER_RATE_DELTA_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                       ppi.NEW_DASH_POWER_RATE_DELTA_MIN = Double.parseDouble(num.image);
      break;
    case NEW_STAMINA_INC_MAX_DELTA_FACTOR:
      jj_consume_token(NEW_STAMINA_INC_MAX_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                          ppi.NEW_STAMINA_INC_MAX_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case PLAYER_DECAY_DELTA_MAX:
      jj_consume_token(PLAYER_DECAY_DELTA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                ppi.PLAYER_DECAY_DELTA_MAX = Double.parseDouble(num.image);
      break;
    case PLAYER_DECAY_DELTA_MIN:
      jj_consume_token(PLAYER_DECAY_DELTA_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                ppi.PLAYER_DECAY_DELTA_MIN = Double.parseDouble(num.image);
      break;
    case PLAYER_SIZE_DELTA_FACTOR:
      jj_consume_token(PLAYER_SIZE_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                  ppi.PLAYER_SIZE_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case PLAYER_SPEED_MAX_DELTA_MAX:
      jj_consume_token(PLAYER_SPEED_MAX_DELTA_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                    ppi.PLAYER_SPEED_MAX_DELTA_MAX = Double.parseDouble(num.image);
      break;
    case PLAYER_SPEED_MAX_DELTA_MIN:
      jj_consume_token(PLAYER_SPEED_MAX_DELTA_MIN);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                    ppi.PLAYER_SPEED_MAX_DELTA_MIN = Double.parseDouble(num.image);
      break;
    case PLAYER_TYPES:
      jj_consume_token(PLAYER_TYPES);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                      ppi.PLAYER_TYPES = Integer.parseInt(num.image);
                                                                  pti.setNoOfPlayerTypes(ppi.PLAYER_TYPES);
      break;
    case PT_MAX:
      jj_consume_token(PT_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                ppi.PT_MAX = Integer.parseInt(num.image);
      break;
    case RANDOM_SEED:
      jj_consume_token(RANDOM_SEED);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                     ppi.RANDOM_SEED = Double.parseDouble(num.image);
      break;
    case STAMINA_INC_MAX_DELTA_FACTOR:
      jj_consume_token(STAMINA_INC_MAX_DELTA_FACTOR);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                                      ppi.STAMINA_INC_MAX_DELTA_FACTOR = Double.parseDouble(num.image);
      break;
    case SUBS_MAX:
      jj_consume_token(SUBS_MAX);
      jj_consume_token(SEP);
      num = jj_consume_token(NUM);
                                  ppi.SUBS_MAX = Integer.parseInt(num.image);
      break;
    default:
      jj_la1[5] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void useless() throws ParseException {
    label_3:
    while (true) {
      switch (jj_nt.kind) {
      case SEP:
      case QM:
      case NUM:
      case NAM:
        ;
        break;
      default:
        jj_la1[6] = jj_gen;
        break label_3;
      }
      switch (jj_nt.kind) {
      case NAM:
        jj_consume_token(NAM);
        break;
      case SEP:
        jj_consume_token(SEP);
        break;
      case NUM:
        jj_consume_token(NUM);
        break;
      case QM:
        jj_consume_token(QM);
        break;
      default:
        jj_la1[7] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  public ParamParserTokenManager token_source;
  SimpleCharStream jj_input_stream;
  public Token token, jj_nt;
  private int jj_gen;
  final private int[] jj_la1 = new int[8];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static private int[] jj_la1_2;
  static private int[] jj_la1_3;
  static {
      jj_la1_0();
      jj_la1_1();
      jj_la1_2();
      jj_la1_3();
   }
   private static void jj_la1_0() {
      jj_la1_0 = new int[] {0x0,0xf5fffff0,0x0,0x0,0xf5fffff0,0x0,0x0,0x0,};
   }
   private static void jj_la1_1() {
      jj_la1_1 = new int[] {0x0,0xffffffef,0x0,0x0,0xffffffef,0x0,0x0,0x0,};
   }
   private static void jj_la1_2() {
      jj_la1_2 = new int[] {0x0,0xfff,0x0,0xfffff000,0xfff,0xfffff000,0x0,0x0,};
   }
   private static void jj_la1_3() {
      jj_la1_3 = new int[] {0x10,0x8,0x10,0x7,0x8,0x7,0x3c0,0x3c0,};
   }

  public ParamParser(java.io.InputStream stream) {
     this(stream, null);
  }
  public ParamParser(java.io.InputStream stream, String encoding) {
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source = new ParamParserTokenManager(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 8; i++) jj_la1[i] = -1;
  }

  public void ReInit(java.io.InputStream stream) {
     ReInit(stream);
  }
  public void ReInit(java.io.InputStream stream, String encoding) {
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 8; i++) jj_la1[i] = -1;
  }

  public ParamParser(java.io.Reader stream) {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new ParamParserTokenManager(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 8; i++) jj_la1[i] = -1;
  }

  public void ReInit(java.io.Reader stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 8; i++) jj_la1[i] = -1;
  }

  public ParamParser(ParamParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 8; i++) jj_la1[i] = -1;
  }

  public void ReInit(ParamParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 8; i++) jj_la1[i] = -1;
  }

  final private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken = token;
    if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
    else jj_nt = jj_nt.next = token_source.getNextToken();
    if (token.kind == kind) {
      jj_gen++;
      return token;
    }
    jj_nt = token;
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }

  final public Token getNextToken() {
    if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
    else jj_nt = jj_nt.next = token_source.getNextToken();
    jj_gen++;
    return token;
  }

  final public Token getToken(int index) {
    Token t = token;
    for (int i = 0; i < index; i++) {
      if (t.next != null) t = t.next;
      else t = t.next = token_source.getNextToken();
    }
    return t;
  }

  private java.util.Vector jj_expentries = new java.util.Vector();
  private int[] jj_expentry;
  private int jj_kind = -1;

  public ParseException generateParseException() {
    jj_expentries.removeAllElements();
    boolean[] la1tokens = new boolean[106];
    for (int i = 0; i < 106; i++) {
      la1tokens[i] = false;
    }
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 8; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & (1<<j)) != 0) {
            la1tokens[j] = true;
          }
          if ((jj_la1_1[i] & (1<<j)) != 0) {
            la1tokens[32+j] = true;
          }
          if ((jj_la1_2[i] & (1<<j)) != 0) {
            la1tokens[64+j] = true;
          }
          if ((jj_la1_3[i] & (1<<j)) != 0) {
            la1tokens[96+j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 106; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.addElement(jj_expentry);
      }
    }
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
    }
    return new ParseException(token, exptokseq, tokenImage);
  }

  final public void enable_tracing() {
  }

  final public void disable_tracing() {
  }

}
